SET(TEST_NAME hellotest)
SET(TEST_SRCS test_hello.cpp)

ENABLE_TESTING()
FIND_PACKAGE(GTest REQUIRED)
INCLUDE_DIRECTORIES(${GTEST_INCLUDE_DIR})

ADD_EXECUTABLE(${TEST_NAME} ${TEST_SRCS})
TARGET_LINK_LIBRARIES(${TEST_NAME} gtest gtest_main ${PROJECT_NAME})
GTEST_ADD_TESTS(${TEST_NAME} "" ${TEST_SRCS})
TARGET_COMPILE_OPTIONS(${TEST_NAME} PUBLIC -std=c++11 -Wall -Wextra -Werror -g)

ADD_CUSTOM_TARGET(testcpp COMMAND ${TEST_NAME})
ADD_DEPENDENCIES(testcpp ${TEST_NAME})

